'\"macro stdmacro
.TH FIND-FILTER 1 "PCP" "Performance Co-Pilot"
.SH NAME
\f3find-filter\f1 \- fine-grained file selection based on time attributes
.SH SYNOPSIS
\f3$PCP_BINADM_DIR/find-filter\f1
[\f3\-v?\f1]
\f2predicate\f1
.SH DESCRIPTION
.B find-filter
is a filter for a list
of file names read on standard input, and if the files match the
.I predicate
their names are written on standard output.
.PP
The supported
.I predicate
forms are based on the file's creation
time or modification time, and take the form
.B ctime
or
.B mtime
followed by a time specification.
A time specification takes the form of a \f3+\f1 or
\f3-\f1 followed by days (a non-negative integer),
optionally followed by a colon (\f3:\f1) and hours
(an integer in the range 0 to 23),
optionally followed by another colon (\f3:\f1)
and minutes (an integer in the range 0 to 59).
.PP
The semantics of the time specification are that a file matches
the predicate if the
chosen time attribute for the file is
.I "less than"
(\f3+\f1) the current time
minus the time specification, else
.I "more than or equal to"
(\f3-\f1) the current time
minus the time specification.
Alternatively, \f3+\f1 means
.I before
the current time minus the
time specification, and
\f3-\f1 means
.I at
or
.I after
the current time minus the
time specification.
.PP
.B find-filter
is intended to be used to provide finer-grain and platform independent
selection compared to the
.B \-mtime
or
.B \-ctime
options of
.BR find (1).
.B find-filter
is expected to be used as a post-filter for the output from
.BR find (1),
and this is how it is used in the
.BR pmlogger_daily (1)
scripts to select files to be compressed or culled.
.SH EXAMPLES
The following
.I predicate
examples illustrate some typical uses.
.IP "\fBmtime +3" 12n
Matches files modified more than 3 days ago.
.IP "\fBctime -0:2" 12n
Matches files created in the last 2 hours.
.IP "\fBctime +0:0:15" 12n
Matches files created more than 15 minutes ago.
.SH DIAGNOSTICS
There are none, unless the
.B \-v
option is used, in which case some diagnostics are written to standard
error.
.PP
Exit status is always zero, unless there are errors found
when parsing the command line arguments.
.SH SEE ALSO
.BR find (1)
and
.BR pmlogger_daily (1).
